<?php
class Model_Eav_Resource_Collection_Abstract
    extends Eav
{
    protected $_modelName;

    protected $_items = array();

    public function __construct()
    {
        $model = new Zend_Db_Table($this->_entityTableName);
        parent::__construct($model);
    }

    public function load()
    {
        /* @var $model Model_Core_Abstract */
        $resourceModel = new Zend_Db_Table($this->_entityTableName);
        $select = $resourceModel->select();
        $data = $resourceModel->fetchAll($select);

        $optionsModel = new Zend_Db_Table($this->_optionTableName);
        $options = $optionsModel->fetchAll();

        foreach ($data as $_item) {
            $model = new $this->_modelName();

            $staticData = $_item->toArray();
            $model->setOriginalData($staticData);

            foreach ($options as $_option) {
                $model->setOriginalData($_option->code,$this->getOptionValue($_item,$_option));
            }

            $model->setPrimary($this->_entityFieldId);
            $model->setIsNew(false);

            $this->_items[$model->getId()] = $model;
        }
    }

    public function getItems()
    {
        return $this->_items;
    }
}